package by.amakarevich.services;

import java.util.List;

import javax.persistence.metamodel.SingularAttribute;

import org.springframework.transaction.annotation.Transactional;

import by.amakarevich.datamodel.Product;
import by.amakarevich.datamodel.enums.Category;

public interface ProductService {
	
	Product get(Long id);

	@Transactional
	void saveOrUpdate(Product product);

	@Transactional
	void delete(Product product);

	@Transactional
	void deleteAll();
	
	List<Product> getAllProductsByCompany(String company, Category category);
	
	List<Product> getAllProductsByCategory(Category category);
	
	String getRootFolder() ;
	
	List<Product> getSortedAllProduct(SingularAttribute<Product, ?> attr, boolean ascending, int startRecord, int pageSize, Category category);


	List<Product> getSortedAllProduct(SingularAttribute<Product, ?> attr, boolean ascending,
			int startRecord, int pageSize, Category category, String company);
			
	Long getCount(Category category);
	
	Long getCount(Category category, String company);
}
